package p.sunmes.les.util;

import java.util.Calendar;

public class TimeUtil {

	public static boolean isToday(long time) {
		Calendar now = Calendar.getInstance();
		Calendar t = Calendar.getInstance();
		t.setTimeInMillis(time);
		if (now.get(Calendar.YEAR) == t.get(Calendar.YEAR) && now
				.get(Calendar.DAY_OF_YEAR) == t.get(Calendar.DAY_OF_YEAR)) {
			return true;
		}
		return false;
	}

	public static String formatMMSS(float dt) {
		int second = (int) (dt % 60);
		int minus = (int) (dt / 60);
		return String.format("%d:%d", minus, second);
	}

}
